package org.sidora.strata.context.types;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import org.openide.util.NbBundle;
import org.openide.util.Utilities;
import org.openide.windows.TopComponent;
import org.sidora.core.context.EmptyedContext;


/**
 * Action which shows Emptyed component
 * @author Enric Tartera, Juan Manuel Gimeno, Roger Masgoret
 * @version 1.0
 */
public class EmptyedAction extends AbstractAction {
    
    public EmptyedAction() {
        super(NbBundle.getMessage(EmptyedAction.class, "CTL_EmptyedAction"));
//        putValue(SMALL_ICON, new ImageIcon(Utilities.loadImage(EmptyedTopComponent.ICON_PATH, true)));
    }
    
    public void actionPerformed(ActionEvent evt) {
        TopComponent win = EmptyedTopComponent.findInstance();
        win.open();
        win.requestActive();
    }
    
    public void actionPerformed() {
        EmptyedTopComponent win = EmptyedTopComponent.findInstance();
        win.open();
        win.requestActive();
        win.fillItems();
    }
    
    public void saveMeasures() {
        EmptyedTopComponent win = EmptyedTopComponent.findInstance();
        win.saveMeasureSet();
    }
    
    public void cerrar() {
        EmptyedTopComponent win = EmptyedTopComponent.findInstance();
        win.close();
    }
}
